//
//  IPubHistoryTableViewCell.m
//  YinHang
//
//  Created by 123 on 14-6-29.
//  Copyright (c) 2014年 孙彦鹏. All rights reserved.
//

#import "IPubHistoryTableViewCell.h"

@implementation IPubHistoryTableViewCell

- (void)awakeFromNib
{
    // Initialization code
    UIImage *cell_bgImg = [UIImage imageNamed:@"ipubhistory_cellbg"];
    _cell_bgImgView.image = [cell_bgImg stretchableImageWithLeftCapWidth:cell_bgImg.size.width*0.5f topCapHeight:cell_bgImg.size.height*0.5f];
    
    UIImage *deleteBtn_bgImg = [[UIImage imageNamed:@"ipubhistory_edit"] resizableImageWithCapInsets:UIEdgeInsetsMake(2, 7, 2, 7) resizingMode:UIImageResizingModeStretch];
    UIImage *deleteBtn_highlightedImg = [[UIImage imageNamed:@"ipubhistory_edit_pressed"] resizableImageWithCapInsets:UIEdgeInsetsMake(2, 7, 2, 7) resizingMode:UIImageResizingModeStretch];
    [_deleteBtn setBackgroundImage:deleteBtn_bgImg forState:UIControlStateNormal];
    [_deleteBtn setBackgroundImage:deleteBtn_highlightedImg forState:UIControlStateHighlighted];
    
    isHide = NO;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

// 隐藏信息
- (IBAction)hideInfo:(id)sender {
    if (isHide == NO) {
        [_hideBtn setBackgroundImage:[UIImage imageNamed:@"ipubhistory_offbtn"] forState:UIControlStateNormal];
        isHide = YES;
    } else {
        [_hideBtn setBackgroundImage:[UIImage imageNamed:@"ipubhistory_onbtn"] forState:UIControlStateNormal];
        isHide = NO;
    }
}

@end
